<?php
Route::post('register', 'AuthController@register'); // 注册
Route::post('login', 'AuthController@login'); // 登录
Route::post('password_reset', 'AuthController@passwordReset'); // 忘记登录密码

Route::get('articles/{type}', 'ArticleController@lists')->where('type', '[a-z]+');; // 文章列表
Route::get('articles/{articles}', 'ArticleController@show'); // 文章详情

Route::get('coins/{type}', 'TradeController@coins'); // 24小时成交量/成交额
Route::get('coins/{coinId}/info', 'TradeController@info'); // 交易页面头部数据
Route::get('coins/{coinId}/trading', 'TradeController@trading'); // 委托中交易记录
Route::get('depth','TradeController@depth'); // 深度图数据
Route::get('chart','TradeController@chart'); // k线图数据
Route::group(['middleware' => 'auth:api'], function (){
    Route::post('info', 'UserController@info'); // 实名认证
    Route::post('infoIdCard', 'UserController@infoIdCard'); // 实名认证身份证

    Route::post('password', 'UserController@updatePassword'); // 修改登录密码
    Route::post('pay_password', 'UserController@setPayPassword'); // 设置交易密码
    Route::post('pay_password_reset', 'UserController@updatePayPassword'); // 修改交易密码
    Route::get('invite', 'UserController@invite'); // 获取邀请码
    Route::get('invitelist','UserController@inviteList'); // 推荐名单

    Route::get('coins','AssetController@coin'); // 币种资产明细
    Route::get('asset','AssetController@asset'); // 总资产、净资产

    Route::post('recharges', 'FinanceController@rechargeStore'); // 充值
    Route::get('recharges', 'FinanceController@rechargeIndex'); // 充值记录
    Route::get('recharges/{rechargeId}', 'FinanceController@rechargeShow'); // 充值详情
    Route::delete('recharges/{rechargeId}', 'FinanceController@rechargeDestroy'); // 充值撤销

    Route::post('withdraws', 'FinanceController@withdrawsStore'); // 提现
    Route::get('withdraws', 'FinanceController@withdrawsIndex'); // 提现记录
    Route::get('withdraws/{withdrawId}', 'FinanceController@withdrawsShow'); // 提现详情

    Route::post('imports', 'FinanceController@import'); // 虚拟币转入
    Route::get('imports/record/{coinId}', 'FinanceController@importRecord'); // 虚拟币转入记录
    Route::post('exports', 'FinanceController@export'); // 虚拟币转出
    Route::get('export/record/{coinId}', 'FinanceController@exportRecord'); // 虚拟币转出记录
    Route::get('show/{id}', 'FinanceController@Show'); // 虚拟币转出/转入详情

    Route::post('bankcards', 'FinanceController@bankcardsStore'); // 添加银行卡
    Route::delete('bankcards/{bankcardId}', 'FinanceController@bankcardsDestroy'); // 删除银行卡

    Route::get('coins/{coinId}/my_trading', 'TradeController@myTrading'); // 委托管理
    Route::delete('trades/{tradeId}', 'TradeController@cancel'); // 交易撤销
    Route::get('record/{coinId}/{type}', 'TradeController@record'); // 用户成交纪录

    Route::group(['middleware' => 'status.5'], function (){
        Route::post('trades/{coins}', 'TradeController@trade'); // 交易
    });
});